import { IsBoolean, IsNumber, IsOptional } from 'class-validator';
import { ApiProperty } from '@nestjs/swagger';

export class QueryMessageDto {
  @ApiProperty({ description: '页码', required: false, default: 1 })
  @IsNumber()
  @IsOptional()
  pageNum?: number = 1;

  @ApiProperty({ description: '每页数量', required: false, default: 10 })
  @IsNumber()
  @IsOptional()
  pageSize?: number = 10;

  @ApiProperty({
    description: '消息类型: 1-系统消息, 2-交易消息, 3-聊天消息',
    required: false,
  })
  @IsNumber()
  @IsOptional()
  type?: number;

  @ApiProperty({ description: '是否只看未读', required: false, default: false })
  @IsBoolean()
  @IsOptional()
  unreadOnly?: boolean = false;

  @ApiProperty({ description: '发送者ID', required: false })
  @IsNumber()
  @IsOptional()
  fromUserId?: number;
}
